]> dgit.raspbian.org Git - gnome-shell.git/commit
st/adjustment: Ensure changed signal emission is compressed
authorJulian Sparber <julian@sparber.net>
Tue, 21 Nov 2023 10:20:06 +0000 (11:20 +0100)
committerJulian Sparber <julian@sparber.net>
Tue, 21 Nov 2023 15:31:56 +0000 (16:31 +0100)
commit78eb5f2a686059828e230968c5a62b77fa8a3132
tree942a19da44a78a49b3f69dab732b40aedcbb7b1d
parent81f18d7ddb7415e6a6fb315151ca71056827fe6b
st/adjustment: Ensure changed signal emission is compressed

The docs say that `st_adjustment_set_values()` emits the `changed`
signal only once but it's actually emitted for each changed property,
this uses the `dispatch_properties_changed` vfunc to emit the `changed`
signal only per call to `st_adjustment_set_values()`. As a positive
side effect this also makes it possible to use `g_object_freeze/thaw_notify`
to compress the `changed` signal emission when using the setters for
properties.

This also fixes the wrong emission of the `changed` signal in
`st_adjustment_set_values()` when only the `value` property is changed.

Side note: the code is heavily inspired by GtkAdjustment

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3023>
src/st/st-adjustment.c